import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//引入插件
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import path from 'path' // 关键代码

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver()],
      imports:['vue','vue-router']
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),

],
  resolve: {
    alias: [
        {
            find: '@',
            replacement: path.resolve(__dirname, './src'),
        }
    ]
}
})
